package pri.zxx.excelgenerate.dataentity.entity;

import io.swagger.v3.oas.annotations.media.Schema;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.Data;
import lombok.experimental.Accessors;

import java.util.List;

@Data
@Accessors(chain = true)
@Tag(name = "接口请求参数")
public class CreatRequest {

	@Schema(name = "预估记录id")
	private Long predictionId;

	@Schema(name = "生成pdf报告类型")
	private PredictionTypeEnum predictionTypeEnum;

	@Schema(name = "需要生成报告的模块名称")
	private List<ModuleInfoEnum> createModuleInfoEnums;

	@Schema(name = "需要生成报告的预估区间")
	private List<Range> ranges;

	@Schema(name = "营养师建议")
	private String advise = "思路如下: 给定一个含有n个元素的整型数组a,求a中所有元素的和.问题的难点在于如何使用递归上." + "如果使用递归,则需要考虑如何进行递归执行的开始以及终止条件,首先如果数组元素个数为0,那么和为0.同时,如果数组元素个数为n," + "那么先求出前n-1个元素之和,再加上a[n-1]即可.此时可以完成递归功能.总之,递归就是在某个函数的执行过程中首先判断它的终止条件参数," + "终止条件参数满足终止条件则执行完毕,终止条件参数不满足终止条件则调用它自身执行某项运算,比如这里求和就是执行加法.凡是递归一定都有一个参数作" + "————————————————" + "版权声明：本文为CSDN博主「听说我们认识」的原创文章，遵循CC 4.0 BY-SA版权协议，转载请附上原文出处链接及本声明。" + "原文链接：https://blog.csdn.net/weixin_42515687/article/details/114717052";

	@Schema(hidden = true)
	private TableCreateReq tableCreateReq;

	@Data
	@Accessors(chain = true)
	public static class Range {
		private Integer start;
		private Integer end;

		public Range(Integer start, Integer end) {
			this.start = start;
			this.end = end;
		}
	}

	@Data
	@Accessors(chain = true)
	public static class TableCreateReq {
		//可重复范围 数量
		private double MAX_REPEAT;
		//分割单元格数量
		private int MULT;
		//横向标题
		private List<String> titleList;
		//范围是否作为横向标题
		private Boolean loadRanges = true;//默认带有范围标题

		public TableCreateReq(double MAX_REPEAT, int MULT, List<String> titleList) {
			this.MAX_REPEAT = MAX_REPEAT;
			this.MULT = MULT;
			this.titleList = titleList;
		}

		public TableCreateReq(double MAX_REPEAT, int MULT, List<String> titleList, Boolean loadRanges) {
			this.MAX_REPEAT = MAX_REPEAT;
			this.MULT = MULT;
			this.titleList = titleList;
			this.loadRanges = loadRanges;
		}
	}
}
